package com.ymatou.iapi.im.service;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.im.parameter.CommentDto;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;

import java.util.List;

/**
*根据时间获取评论列表Call
*FreeMaker Template自动生成代码
*/
public class GetCommentListByTimelineCall extends YmatouBaseCall{
	private static String opurl ="api/Message/GetCommentListByTimeline";
	
	public GetCommentListByTimelineCall() {
		super(EnvSetup.getSystemUrl("im_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {

	}
	public List<CommentDto> getCommentDtoList(){
		String Result = getJsonObject().get("Result").getAsJsonArray().toString();
		List<CommentDto> CommentDtoList=(List<CommentDto>) FormatUtil.GSONToObject(Result, new TypeToken<List<CommentDto>>(){}.getType());
		return CommentDtoList;
	}
}